package com.megvii.koala.net.creature;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.megvii.koala.data.bean.CreatureBean;
import com.megvii.koala.data.bean.UpPictureBean;
import com.megvii.koala.net.Commands;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by linyue on 16/1/11.
 */
public class EditCreatureRequest extends AddCreatureRequest
{
    public String id;

    public EditCreatureRequest(CreatureBean creature)
    {
        super(creature);
        this.id = creature.id;
    }


    public EditCreatureRequest(CreatureBean creature,String property)
    {
        super();
        this.subject_type = creature.subject_type;
        this.name = creature.name;
        switch (property){
            case "REMARK":
                this.remark = creature.remark;
                break;
            case "DESCRIPTION":
                this.description = creature.description;
                break;
            case "COME_FORM":
                this.come_from = creature.come_from;
                break;
            case "PHONE":
                this.phone = creature.phone;
                break;
            case "DEPARTMENT":
                this.department = creature.department;
                break;
            case "RANK":
                this.job_number = creature.job_number;
                break;
            case "TITLE":
                this.title = creature.title;
                break;
            case "EMAIL":
                this.email = creature.email;
                break;
        }
        this.id = creature.id;
    }

    @JsonIgnore
    @Override
    public String getCommand()
    {
        return Commands.EDIT_CREATURE + "/" + id;
    }
}
